UnrolledList

Unrolled Linked List.

Nodes are (by default) sized to fit within a 64-byte cache line. The number of items stored per node can be read from the nodeCapacity field.

Disabled Default Constructor

A disabled default is present on this object. To use it, use one of the other constructors or a factory function.

Constructors

this
this(Allocator allocator)

Use the given allocator for allocations.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Postblit

Copying this object is disabled.

A postblit is present on this object, but not explicitly documented in the source.

Members

Aliases

insert
alias insert = insertBack
put
alias put = insertBack

Inserts the given range into the end of the list

Functions

back
inout(T) back()

Time complexity is O(nodeCapacity), where the nodeCapacity is the number of items in a single list node. It is a constant related to the cache line size.

clear
void clear()

Removes all items from the list

empty
bool empty()
front
inout(T) front()

Time complexity is O(1)

insertAnywhere
T* insertAnywhere(T item)

Inserts the given item in the frontmost available cell, which may put the item anywhere in the list as removal may leave gaps in list nodes. Use this only if the order of elements is not important.

insertBack
T* insertBack(T item)

Inserts the given item into the end of the list.

insertBack
void insertBack(auto ref R range)

Inserts the given range into the end of the list

length
size_t length()
moveBack
T moveBack()

Removes an item from the back of the list and returns it.

moveFront
T moveFront()

Pops the front item off of the list and returns it

opOpAssign
T* opOpAssign(T item)

Inserts the given range into the end of the list

opSlice
auto opSlice()
popBack
void popBack()

Pops the back item off of the list.

popFront
void popFront()

Pops the front item off of the list

remove
bool remove(T item)

Removes the first instance of the given item from the list.

See Also

Meta